<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/jsp/commons/taglibs.jsp"%>
<!DOCTYPE html >
<html>
<head>
<jsp:include page="/jsp/commons/cssinclude.jsp"></jsp:include>
<jsp:include page="/jsp/commons/scriptinclude.jsp"></jsp:include>
<meta charset="utf-8">
<title>晶品科技信息管理系统-报价</title>
<meta name="keywords" content="">
<meta name="description" content="">

<script type="text/javascript">
	//分页查询
	function queryCategory() {
		var path = "${ctx}/quote/quoteAction!list.action";
		query(path);
	}
	
	function queryPage(path, pageindex) {
		pageIndex = pageindex;
		query(path);

	}
	$(document).ready(function() {
		queryCategory();

	});
</script>
</head>
<body>
	 
	<div class="mainbox">
		<div class="main_content"> 
			<div class="main_right">
				<div class="main_rightbox">
					<!--面包屑 begin-->
					<div class="ec_crumb_kc">
						<span><a class="icon_index" href="${ctx}/jsp/commons/right.jsp">返回首页</a></span>当前位置：<a
							style="cursor: pointer; color: #0678BD;" href="${ctx }">首页</a>&nbsp;&gt;&nbsp;
					    <c:choose>
					    <c:when test="${pageType eq '1'}">
					    <a style="cursor: pointer; color: #0678BD;" href="${ctx }">项目中心</a>&nbsp;&gt;&nbsp;
						<em> 售后部 </em>
					    </c:when>
					    <c:otherwise>
					    <em> 调度中心 </em>
					    </c:otherwise>
					    </c:choose>
					</div>
					<!--配置图片 begin-->
					 
					 <div class="service">
					 
					    <a class="lmImg icon1" href="${ctx}/quote/quoteAction!addInit.action">报价</a>
					 
					</div>
					<!--查询 begin-->
					<div class="user">
						<div class="user_search">
							<form id="businessForm" method="post">
							<div class="frm_cont" id="lmname">
									<label for="lmname">二级单位：</label> <input type="text"
										value="请输入二级单位名称" id="secondInstitutions" onclick="txtCustomerClick()" 
										  />
									 <input type="hidden" id="secondInstitutions" value="" name="quote.secondInstitutions" />
								</div>
								<div class="frm_cont" id="flm">
									<label for="flm">三级单位：</label> <input type="text"
										value="请输入三级单位名称" id="threeInstitutions" onclick="txtCustomerClick()" 
										  />
									 <input type="hidden" id="threeInstitutions" value="" name="quote.threeInstitutions" />
								</div>
								<div class="frm_cont" id="spfl">
									<label for="spfl">项目名称：</label>  
									<input type="text"
										value="请输入项目名称" id="projectName" onclick="txtCustomerClick()" 
										  />
									 <input type="hidden" id="threeInstitutions" value="" name="quote.projectCode" />
									
									 
								</div>
								<div class="frm_cont" id="lrfs">
									<label for="lrfs">状态：</label> <select id="depart"
										name="user.depart"
										style="border: 1px solid #DDDDDD; color: #999999; float: right; height: 29px; line-height: 29px; padding-left: 5px; width: 218px;">
										 
										<option value="">---请选择---</option>
										<c:forEach items="${lstDepart }" var="path" >
										<option value="${path.code }"  <c:if test="${user.depart eq path.code}">selected="selected"</c:if>>${path.value}</option>
										</c:forEach>
									</select>
								</div>
							
								 

							</form>
						</div>
						<div class="tbn_search" id="btncenter">
							<a href="javascript:void(0)"
								onclick="queryPage('${ctx}/quote/quoteAction!list.action',0)">查询</a>
						</div>
						<div class="clear"></div>
					</div>
					<!--表格 & 分页-->
					<div id="Searchresult">
						<table width="100%" border="0" cellspacing="0" cellpadding="0"
							class="tab">
							<tr>
								<th>序号</th>
								<th>二级单位</th>
								<th>三级单位</th>
								<th>总金额</th>
								<th>施工内容</th>
								<th>最后修改时间</th>
								<th>操作</th>
							</tr>
							<tr>
								<td colspan="8">正在查询...</td>
							</tr>
						</table>
					</div>

				</div>
			</div>
		</div>
	</div>
	
    <!--客户弹出层 begin-->
	<div id="customerDialog" style="display: none">
	</div>
	
    <!--项目弹出层 begin-->
	<div id="projectDialog" style="display: none">
	</div>

	<!-- JQ -->
	<script type="text/javascript">
	
	    //加载项目弹出层
	    $("#projectName").click(function(){
	    	 $.post(
		     		 "${ctx}/dispatch/dispatchAction!listDialog.action", 
		 				{random:Math.random()}, 
		 				function(data){
		 					$("#customerDialog").html(data);
							//加载弹出层
		 					art.dialog({
		 					    id: 'msg',
		 					    title: '项目信息',
		 					    content: $("#customerDialog").html(),//绑定内容
		 					    ok: function () {
		 					    	var selectCustomerObj= $("input[name='customerSelected']:checked");
		 					    	 $("#customerName").val($(selectCustomerObj).attr("customerName"));
		 					    	 $("#customerId").val($(selectCustomerObj).attr("customerId"));
		 					    },//确定时回调函数
		 					    cancel:true,//取消时回调函数
		 					    lock: true 
		 					});
		 				}
		      
		        );
	    });
	
	    //加载客户弹出层
	    function txtCustomerClick(){
	    	 $.post(
		     		 "${ctx}/customer/customerAction!initCustomersDialog.action", 
		 				{random:Math.random()}, 
		 				function(data){
		 					$("#customerDialog").html(data);
							//加载弹出层
		 					art.dialog({
		 					    id: 'msg',
		 					    title: '客户信息',
		 					    content: $("#customerDialog").html(),//绑定内容
		 					    ok: function () {
		 					    	var selectCustomerObj= $("input[name='customerSelected']:checked");
		 					    	 $("#customerName").val($(selectCustomerObj).attr("customerName"));
		 					    	 $("#customerId").val($(selectCustomerObj).attr("customerId"));
		 					    },//确定时回调函数
		 					    cancel:true,//取消时回调函数
		 					    lock: true 
		 					});
		 				}
		      
		        );
	    } 
	    
		function updateStatus(dispatchId, flag) {
			//提示语
			var tip = "";
			if (flag == "Y") {
				tip = "启用"; 
			} else {
				tip = "禁用";
			}

			//异步请求修改状态
			if (confirm("确定要" + tip + "该条记录？")) {
				$
						.post(
								"${ctx}/dispatch/dispatchAction!updateState.action",
								{
									random : Math.random(),
									"dispatch.id" : dispatchId,
									"dispatch.state" : flag
								},
								function(data) {
									var jsonData = strToJson(data);
									if (jsonData.flag == "error") {
										alert(jsonData.errorMsg);
									}
									window.location.href = "${ctx}/dispatch/dispatchAction!initdispatch.action";
								});
			}
		}
	</script>
</body>
</html>